package com.wd.elec.controller.job;

import com.wd.elec.service.impl.AttendCalculateService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

import javax.annotation.Resource;
import java.util.Calendar;

/**
 * @className: AttendJob
 * @description: TODO 类描述
 * @author: liumingkun
 * @date: 2023/11/16
 **/
//
@Configuration
public class AttendJob {

    private final static Logger logger= LoggerFactory.getLogger(AttendJob.class);

    @Resource
    AttendCalculateService attendCalculateService;

    @Scheduled(cron = "*/5 * 0 * * *")
    public void calculateAttend() {
        logger.info("begin to calculate attend!");
        Calendar calendar= Calendar.getInstance();
        calendar.set(2023, Calendar.NOVEMBER,16,0,0,0);

        attendCalculateService.calculateAttend(calendar.getTime());
    }
}
